home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
PDReadLog.z
/
PDReadLog
Wrap
Text File
|
1998-10-30
|
12KB
|
265 lines
PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333))))
NNNNAAAAMMMMEEEE
PDReadLog, PDLocalReadLog, PDLocalWriteLog - reads/writes printer log
entries
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ppppoooodddd....hhhh>>>>
iiiinnnntttt PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr____nnnnaaaammmmeeee,,,,
iiiinnnntttt nnnnuuuummmm____eeeennnnttttrrrriiiieeeessss,,,,
PPPPDDDDLLLLooooggggSSSSttttrrrruuuucccctttt ********lllloooogggg____eeeennnnttttrrrriiiieeeesssspppp,,,,
ttttiiiimmmmeeee____tttt ****mmmmoooodddd____ttttiiiimmmmeeeepppp))));;;;
iiiinnnntttt PPPPDDDDLLLLooooccccaaaallllRRRReeeeaaaaddddLLLLoooogggg((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr____nnnnaaaammmmeeee,,,,
iiiinnnntttt nnnnuuuummmm____eeeennnnttttrrrriiiieeeessss,,,,
PPPPDDDDLLLLooooggggSSSSttttrrrruuuucccctttt ********lllloooogggg____eeeennnnttttrrrriiiieeeesssspppp,,,,
ttttiiiimmmmeeee____tttt ****mmmmoooodddd____ttttiiiimmmmeeeepppp))));;;;
iiiinnnntttt PPPPDDDDLLLLooooccccaaaallllWWWWrrrriiiitttteeeeLLLLoooogggg((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr____nnnnaaaammmmeeee,,,,
ccccoooonnnnsssstttt cccchhhhaaaarrrr ****jjjjoooobbbb____iiiidddd,,,,
ccccoooonnnnsssstttt cccchhhhaaaarrrr ****uuuusssseeeerrrrnnnnaaaammmmeeee,,,,
PPPPDDDDMMMMeeeessssssssaaaaggggeeeeSSSSttttrrrruuuucccctttt ****lllloooogggg____mmmmssssgggg))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_P_D_R_e_a_d_L_o_g and _P_D_L_o_c_a_l_R_e_a_d_L_o_g attempt to read _n_u_m__e_n_t_r_i_e_s entries from the
specified printer's log file. The functions fill an array of _P_D_L_o_g_S_t_r_u_c_t
structures, one for each log entry. _l_o_g__e_n_t_r_i_e_s_p is set to point to this
array of log entries. The log entries are read starting with the last
entry and proceeding back in time toward the beginning of the log file.
The first element in the returned _l_o_g__e_n_t_r_i_e_s_p array represents the most
recent entry in the log file. If _n_u_m__e_n_t_r_i_e_s is specified as PPPPDDDD____LLLLOOOOGGGG____AAAALLLLLLLL,
all entries in the log file will be read. _m_o_d__t_i_m_e_p is set to the time
the printer log information was last modified (see _t_i_m_e(_2)).
_P_D_L_o_c_a_l_W_r_i_t_e_L_o_g appends the log entry to the end of the specified
printer's log file. If the _j_o_b__i_d and _u_s_e_r_n_a_m_e are not known, they may be
specified as NNNNUUUULLLLLLLL. A time stamp is automatically generated for the log
entry.
The local functions are designed for use with local printers only. Refer
to the _l_i_b_p_o_d(_3) man page for more information.
The _P_D_L_o_g_S_t_r_u_c_t structure is defined as follows.
typedef struct _pdLogStruct {
time_t time_stamp; /* Log entry time stamp */
char *job_id; /* Job ID */
char *username; /* Job owner's user name */
PDMessageStruct entry; /* Log entry */
} PDLogStruct;
PPPPaaaaggggeeee 1111
PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333))))
_t_i_m_e__s_t_a_m_p Time stamp string indicating when the log entry was
recorded. This is the time as returned by time(2).
This value can be converted into a time string using
the ctime(3) function.
_j_o_b__i_d Print job ID assigned by the printer spooling system.
This field may be NNNNUUUULLLLLLLL if no job ID was specified
when the log entry was written.
_u_s_e_r_n_a_m_e User name of the print job owner. This field may be
NNNNUUUULLLLLLLL if no username was specified when the log entry
was written.
_e_n_t_r_y Log entry message.
The _P_D_M_e_s_s_a_g_e_S_t_r_u_c_t is defined as follows.
typedef struct _pdMessageStruct {
int message_code;
char message_text[PD_STR_MAX];
} PDMessageStruct;
_m_e_s_s_a_g_e__c_o_d_e Error, warning or information message code ID (see
_p_o_d._h).
_m_e_s_s_a_g_e__t_e_x_t Text for the message truncated to a length of
PD_STR_MAX-1.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
_P_D_R_e_a_d_L_o_g and _P_D_L_o_c_a_l_R_e_a_d_L_o_g return the number of log file entries
actually read if the function call was successful. _P_D_L_o_c_a_l_W_r_i_t_e_L_o_g
returns 0 if the call was successful. All functions return -1 and set
_P_D_e_r_r_n_o if an execution error has occurred.
EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
_P_D_L_o_c_a_l_R_e_a_d_L_o_g and _P_D_R_e_a_d_L_o_g will fail under the following circumstances.
PD_LIBERR_BAD_PNAME A NULL or empty printer name string has been
specified.
PD_LIBERR_BAD_NENTRIES An invalid number of log entries has been
specified for reading.
PD_LIBERR_LOG_READ The log file could not be opened for reading or
an error occurred while reading the file.
In addtion, _P_D_R_e_a_d_L_o_g will fail under the following circumstance.
PD_LIBERR_NO_PRINTER The specified printer has not been registered
with the printer spooling system and is,
therefore, inaccessible.
PPPPaaaaggggeeee 2222
PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333))))
PD_LIBERR_BAD_HOSTNAME The network address of the specified hostname
could not be found.
PD_LIBERR_NETWORK For an unknown reason, a network connection
could not be made with the remote printer host.
PD_LIBERR_NET_TIMEOUT A timeout occurred while attempting to
communicate with the remote printer host.
PD_LIBERR_NET_INTR The program has been interrupted while
attempting to communicate with the remote
printer host.
PD_LIBERR_NET_NOTREG The podd daemon is not registered on the remote
printer host.
PD_LIBERR_NET_PMAP The port mapper daemon failed on the remote
printer host.
PD_LIBERR_NET_NOPROC The client has called a libpod function that is
not supported by the podd daemon on the remote
printer host.
PD_LIBERR_NET_CLNTXDR The libpod library XDR routines and the kernel's
XDR routines are incompatible.
PD_LIBERR_NET_SVCXDR The podd daemon XDR routines and the remote
printer host's kernel XDR routines are
incompatible.
PD_LIBERR_NET_RPCMATCH The version of RPC software on the client is
incompatible with the version on the remote
printer host.
PD_LIBERR_NET_PROCMATCH The version of the specified libpod function on
the client is incompatible with the version on
the remote printer host.
_P_D_L_o_c_a_l_W_r_i_t_e_L_o_g will fail under the following circumstances.
PD_LIBERR_BAD_STRUCT A NULL structure pointer has been specified.
PD_LIBERR_BAD_PNAME A NULL or empty printer name string has been
specified.
PD_LIBERR_LOG_WRITE The log file could not be opened for writing or
an error occurred while writing the file.
PPPPaaaaggggeeee 3333
PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo PPPPDDDDRRRReeeeaaaaddddLLLLoooogggg((((3333))))
WARNINGS
1. Upon successful execution, the _P_D_R_e_a_d_L_o_g and _P_D_L_o_c_a_l_R_e_a_d_L_o_g
functions sets _l_o_g__e_n_t_r_i_e_s_p to point to an array of log file
entries. The storage for this array will be reallocated with
subsequent calls to these functions. To preserve the array of log
entries across subsequent calls, they should be copied to user-
allocated storage.
2. The function _P_D_R_e_a_d_L_o_g calls the _l_i_b_s_p_o_o_l function _S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o.
This _l_i_b_s_p_o_o_l function is not reentrant. This means that any pointer
returned by a previous call to _S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o will be invalid
after a call to _P_D_R_e_a_d_L_o_g.
NNNNOOOOTTTTEEEE
Since the POD files are owned by the lp account, super-user or lp account
privilege is required to successfully call the _P_D_L_o_c_a_l_W_r_i_t_e_L_o_g function.
FFFFIIIILLLLEEEESSSS
/var/spool/lp/pod/[printer name].log
SSSSEEEEEEEE AAAALLLLSSSSOOOO
libpod(3), time(2), ctime(3)
PPPPaaaaggggeeee 4444